package com.toro.dao;

import com.toro.domain.Group;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: GroupDao
 * @Description:
 * @Author: ToroLHZ
 * @Date: 2023/12/17 14:37
 */
public interface GroupDao {
    /**
     * @Description: 获取群成员
     * @Param: [groupId]
     * @Return: java.util.ArrayList<java.lang.Integer>
     * @Author: ToroLHZ
     * @Date: 2023/12/24 14:58
     **/
    List<Integer> getAllMembers(int groupId);

    /**
     * @Description: 创建群
     * @Param: [groupname, creator, memberslist]
     * @Return: java.lang.Boolean
     * @Author: ToroLHZ
     * @Date: 2023/12/17 15:23
     **/
    Boolean createGroup(String groupName, String creator, ArrayList<Integer> membersList);

    /**
     * @Description: 加入群
     * @Param: []
     * @Return: boolean
     * @Author: ToroLHZ
     * @Date: 2023/12/17 15:24
     **/
    boolean joinGroup(int groupId, int userId);

    /**
     * @Description: 获取群id
     * @Param: [GroupName]
     * @Return: int
     * @Author: ToroLHZ
     * @Date: 2023/12/17 21:46
     **/
    int getGroupIdByGroupName(String GroupName);

    /**
     * @Description: 通过群名称获取群数据
     * @Param: [groupName]
     * @Return: Group
     * @Author: ToroLHZ
     * @Date: 2023/12/24 15:03
     **/
    Group getGroupByGroupName(String groupName);

    /**
     * @Description: 获取成员id, 判断用户是否在群内
     * @Param: [groupId, userId]
     * @Return: Group
     * @Author: ToroLHZ
     * @Date: 2023/12/26 18:59
     **/
    boolean InGroupByGroupIdUserId(int groupId, int userId);

    /**
     * @Description: 删除数据通过id
     * @Param: [userId, groupId]
     * @Return: void
     * @Author: ToroLHZ
     * @Date: 2023/12/26 19:45
     **/
    void deleteUserById(int userId, int groupId);
}
